// Install CommandLineParser via scriptcs if necessary
#addin "nuget: CommandLineParser, 2.9.0"

// webview2.csx

using CommandLine;

public class Options
{
    [Value(0, MetaName = "arg1", HelpText = "First argument", Required = true)]
    public int Arg1 { get; set; }

    [Value(1, MetaName = "arg2", HelpText = "Second argument", Required = true)]
    public int Arg2 { get; set; }
}

Parser.Default.ParseArguments<Options>(args)
    .WithParsed(options =>
    {
        Console.WriteLine($"Argument 1: {options.Arg1}");
        Console.WriteLine($"Argument 2: {options.Arg2}");
    })
    .WithNotParsed(errors =>
    {
        Console.WriteLine("Error parsing arguments.");
    });
